//
//  Device_GetClipboardDataHandler.swift
//  mall-ios
//
//  Created by Meak Tsui on 2018/11/28.
//  Copyright © 2018 Meak Tsui. All rights reserved.
//

import Foundation
import UIKit
import MTHybrid
import Shared

extension Api {
    static let GetClipboardData = Api("getClipboardData")
}

/// 获取剪贴板内容
class Device_GetClipboardDataHandler: MTEventHandler {
    var ns: Ns {
        return .Device
    }
    
    var action: Api {
        return .GetClipboardData
    }
    
    func handler(_ msg: MTHybridMsg) {
        let str = UIPasteboard.general.string ?? ""
        dPrint(str)
        msg.callbackClosure?(str)
    }
    
    
}
